<template>
	<view>
		<card-text :wordList="wordList" :commentCount="commentCount"></card-text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				wordList: [{
					'title': '以正义的烈火拔出黑暗。我有自己的正义',
					'content': '折磨生出苦难，苦难又会加剧折磨，凡间这无穷的循环，将有我来终结！因情感而真诚，因脆弱而自由！',
					'praiseCount': 0,
					'watchCount': 40,
					'commentPraiseCount': 100,
					'commentCount': 60,
				}],
				href: 'https://uniapp.dcloud.io/component/README?id=uniui'
			}
		},
		onLoad() {
			console.log('onLoad===')
			this.getWordList()
		},
		methods: {
			// 获取列表
			getWordList(){
				const params = {
					date: this.$u.timeFormat(new Date().getTime(),'yyyy-mm-dd')
				};
				this.$u.api.fetchWordList(params).then(res=>{
					console.log('res===', res)
					if(res.code === 0){
						this.wordList = res.result;
					}else{
						console.warn('wordList-codeError')
					}
				}).catch(err=>{
					console.log('err',err)
				})
			},
			// 获取评论总数
			getWordCommentCount(){
				const params = {
					
				};
				this.$u.api.getComments(params).then((res)=>{
					if(res.code === 0){
						
					}else{
						
					}
					
				})
			},
		}
	}
</script>

<style>
	.container {
		padding: 20px;
		font-size: 14px;
		line-height: 24px;
	}
</style>
